/*
 * Copyright 2016, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "hardware_legacy/wifi_hal.h"

wifi_error wifi_initialize(wifi_handle *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_wait_for_driver_ready()
{
    return WIFI_SUCCESS;
}

void wifi_cleanup(wifi_handle, wifi_cleaned_up_handler)
{
}

void wifi_event_loop(wifi_handle)
{
}

wifi_error wifi_get_supported_feature_set(wifi_interface_handle, feature_set *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_concurrency_matrix(wifi_interface_handle, int, feature_set set[], int *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_scanning_mac_oui(wifi_interface_handle, oui)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_ifaces(wifi_handle, int *, wifi_interface_handle **)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_iface_name(wifi_interface_handle, char *, size_t)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_start_gscan(wifi_request_id, wifi_interface_handle, wifi_scan_cmd_params, wifi_scan_result_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_stop_gscan(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_cached_gscan_results(wifi_interface_handle, byte, int, wifi_cached_scan_results *, int *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_bssid_hotlist(wifi_request_id, wifi_interface_handle, wifi_bssid_hotlist_params,
                                  wifi_hotlist_ap_found_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_reset_bssid_hotlist(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_significant_change_handler(wifi_request_id, wifi_interface_handle,
                                               wifi_significant_change_params, wifi_significant_change_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_reset_significant_change_handler(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_gscan_capabilities(wifi_interface_handle, wifi_gscan_capabilities *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_link_stats(wifi_request_id, wifi_interface_handle, wifi_stats_result_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_link_stats(wifi_interface_handle, wifi_link_layer_params)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_clear_link_stats(wifi_interface_handle, u32, u32 *, u8, u8 *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_valid_channels(wifi_interface_handle, int, int, wifi_channel *, int *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_rtt_range_request(wifi_request_id, wifi_interface_handle, unsigned, wifi_rtt_config rtt_config[],
                                  wifi_rtt_event_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_rtt_range_cancel(wifi_request_id, wifi_interface_handle, unsigned, mac_addr addr[])
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_rtt_capabilities(wifi_interface_handle, wifi_rtt_capabilities *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_rtt_get_responder_info(wifi_interface_handle, wifi_rtt_responder *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_enable_responder(wifi_request_id, wifi_interface_handle, wifi_channel_info, unsigned,
                                 wifi_rtt_responder*)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_disable_responder(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_nodfs_flag(wifi_interface_handle, u32)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_start_logging(wifi_interface_handle, u32, u32, u32, u32, char *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_epno_list(wifi_request_id, wifi_interface_handle, const wifi_epno_params *, wifi_epno_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_reset_epno_list(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_country_code(wifi_interface_handle, const char *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_firmware_memory_dump( wifi_interface_handle, wifi_firmware_memory_dump_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_log_handler(wifi_request_id, wifi_interface_handle, wifi_ring_buffer_data_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_reset_log_handler(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_alert_handler(wifi_request_id, wifi_interface_handle, wifi_alert_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_reset_alert_handler(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_firmware_version(wifi_interface_handle, char *, int)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_ring_buffers_status(wifi_interface_handle, u32 *, wifi_ring_buffer_status *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_logger_supported_feature_set(wifi_interface_handle, unsigned int *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_ring_data(wifi_interface_handle, char *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_driver_version(wifi_interface_handle, char *, int)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_start_rssi_monitoring(wifi_request_id, wifi_interface_handle, s8, s8, wifi_rssi_event_handler)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_stop_rssi_monitoring(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

static wifi_error wifi_configure_nd_offload(wifi_interface_handle, u8)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_start_sending_offloaded_packet(wifi_request_id, wifi_interface_handle, u16, u8 *, u16, u8 *, u8 *, u32)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_stop_sending_offloaded_packet(wifi_request_id, wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_start_pkt_fate_monitoring(wifi_interface_handle)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_tx_pkt_fates(wifi_interface_handle, wifi_tx_report *, size_t, size_t *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_rx_pkt_fates(wifi_interface_handle, wifi_rx_report *, size_t, size_t *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_get_packet_filter_capabilities(wifi_interface_handle, u32 *, u32 *)
{
    return WIFI_SUCCESS;
}

wifi_error wifi_set_packet_filter(wifi_interface_handle, const u8 *, u32)
{
    return WIFI_SUCCESS;
}

wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn)
{
    if (fn == NULL) {
        return WIFI_ERROR_UNKNOWN;
    }
    fn->wifi_initialize = wifi_initialize;
    fn->wifi_wait_for_driver_ready = wifi_wait_for_driver_ready;
    fn->wifi_cleanup = wifi_cleanup;
    fn->wifi_event_loop = wifi_event_loop;
    fn->wifi_get_supported_feature_set = wifi_get_supported_feature_set;
    fn->wifi_get_concurrency_matrix = wifi_get_concurrency_matrix;
    fn->wifi_set_scanning_mac_oui =  wifi_set_scanning_mac_oui;
    fn->wifi_get_ifaces = wifi_get_ifaces;
    fn->wifi_get_iface_name = wifi_get_iface_name;
    fn->wifi_start_gscan = wifi_start_gscan;
    fn->wifi_stop_gscan = wifi_stop_gscan;
    fn->wifi_get_cached_gscan_results = wifi_get_cached_gscan_results;
    fn->wifi_set_bssid_hotlist = wifi_set_bssid_hotlist;
    fn->wifi_reset_bssid_hotlist = wifi_reset_bssid_hotlist;
    fn->wifi_set_significant_change_handler = wifi_set_significant_change_handler;
    fn->wifi_reset_significant_change_handler = wifi_reset_significant_change_handler;
    fn->wifi_get_gscan_capabilities = wifi_get_gscan_capabilities;
    fn->wifi_get_link_stats = wifi_get_link_stats;
    fn->wifi_set_link_stats = wifi_set_link_stats;
    fn->wifi_clear_link_stats = wifi_clear_link_stats;
    fn->wifi_get_valid_channels = wifi_get_valid_channels;
    fn->wifi_rtt_range_request = wifi_rtt_range_request;
    fn->wifi_rtt_range_cancel = wifi_rtt_range_cancel;
    fn->wifi_get_rtt_capabilities = wifi_get_rtt_capabilities;
    fn->wifi_rtt_get_responder_info = wifi_rtt_get_responder_info;
    fn->wifi_enable_responder = wifi_enable_responder;
    fn->wifi_disable_responder = wifi_disable_responder;
    fn->wifi_set_nodfs_flag = wifi_set_nodfs_flag;
    fn->wifi_start_logging = wifi_start_logging;
    fn->wifi_set_epno_list = wifi_set_epno_list;
    fn->wifi_reset_epno_list = wifi_reset_epno_list;
    fn->wifi_set_country_code = wifi_set_country_code;
    fn->wifi_get_firmware_memory_dump = wifi_get_firmware_memory_dump;
    fn->wifi_set_log_handler = wifi_set_log_handler;
    fn->wifi_reset_log_handler = wifi_reset_log_handler;
    fn->wifi_set_alert_handler = wifi_set_alert_handler;
    fn->wifi_reset_alert_handler = wifi_reset_alert_handler;
    fn->wifi_get_firmware_version = wifi_get_firmware_version;
    fn->wifi_get_ring_buffers_status = wifi_get_ring_buffers_status;
    fn->wifi_get_logger_supported_feature_set = wifi_get_logger_supported_feature_set;
    fn->wifi_get_ring_data = wifi_get_ring_data;
    fn->wifi_get_driver_version = wifi_get_driver_version;
    fn->wifi_start_rssi_monitoring = wifi_start_rssi_monitoring;
    fn->wifi_stop_rssi_monitoring = wifi_stop_rssi_monitoring;
    fn->wifi_configure_nd_offload = wifi_configure_nd_offload;
    fn->wifi_start_sending_offloaded_packet = wifi_start_sending_offloaded_packet;
    fn->wifi_stop_sending_offloaded_packet = wifi_stop_sending_offloaded_packet;
    fn->wifi_start_pkt_fate_monitoring = wifi_start_pkt_fate_monitoring;
    fn->wifi_get_tx_pkt_fates = wifi_get_tx_pkt_fates;
    fn->wifi_get_rx_pkt_fates = wifi_get_rx_pkt_fates;
    fn->wifi_get_packet_filter_capabilities = wifi_get_packet_filter_capabilities;
    fn->wifi_set_packet_filter = wifi_set_packet_filter;
    return WIFI_SUCCESS;
}